﻿using System;

namespace xlstool
{
    public class Excel2003File
    {
        internal Excel2003Workbook workbook { get; set; }
        public Excel2003File(Stream xls_stream)
        {
            workbook = new Excel2003Workbook(xls_stream);
        }
        public Excel2003File()
        {
            workbook = new Excel2003Workbook();
        }
        public Excel2003Workbook GetWorkbook()
        {
            return workbook;
        }
        public Excel2003Sheet ToSheet(string name)
        {
            return workbook.ToSheet(name);
        }
        public IEnumerable<Excel2003Sheet> LoopSheet()
        {
            return workbook.LoopSheet();
        }
        public void ToStream(Stream outstream)
        {
            workbook.wb.Write(outstream);
            outstream.Flush();
        }
    }
}
